CREATE PROCEDURE coreAdminUserSave
(
	@PK_ID int output,
	@EmailAddress nvarchar(300),
	@NT_Username nvarchar(200),
	@RealName nvarchar(200),
	@IsSuperUser bit
)
AS
BEGIN
	IF @PK_ID = -1
	BEGIN
		SET NOCOUNT ON;
		INSERT INTO AdministrationUsers (EmailAddress, NT_Username, RealName, IsSuperUser)
		VALUES (@EmailAddress, @NT_Username, @RealName, @IsSuperUser );
		SET NOCOUNT OFF;
		SELECT @PK_ID = @@IDENTITY;
	END
	ELSE
	BEGIN
		UPDATE AdministrationUsers SET EmailAddress=@EmailAddress, RealName=@RealName, IsSuperUser=@IsSuperUser WHERE PK_ID=@PK_ID;
	END
END